/*
  路由JS
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

//引入所需要的界面
import ElLayout from '../pages/el_layout/page_layout'
import el_container from '../pages/el_container/page_container'
import index_page from '../pages/index_page/index_page'
import test from '../pages/test/test'
import el_anzhuang from '../pages/el_kaifa/el_anzhuang'
import el_daimagaoliang from '../pages/el_kaifa/el_daimagaoliang'
import el_MavonEditor from '../pages/el_kaifa/el_MavonEditor'
import el_quickstar from '../pages/el_kaifa/el_quickstar'

//vue使用插件
Vue.use(VueRouter)

//编写路由
export default new VueRouter({
  //配置n个路由
  routes:[
    {
      path:'/',
      redirect:'/indexPage'
    },
    {//首页
      path:'/indexPage',
      component:index_page
    },
    //开发指南
    {//安装
      path:'/el_anzhuang',
      component:el_anzhuang
    },
    {//代码高亮
      path:'/el_daimagaoliang',
      component:el_daimagaoliang
    },
    {//富文本编辑器
      path: '/el_MavonEditor',
      component:el_MavonEditor
    },
    {
      path:'/el_quickstar',
      component:el_quickstar
    },
    {
      path:'/elLayout',
      component:ElLayout
    },
    {
      path:'/el_container',
      component: el_container
    },
    {
      path:'/test',
      component: test
    }
  ],
  scrollBehavior (to, from, savedPosition) {//代码定位到顶部
    // return 期望滚动到哪个的位置
    return { x: 0, y: 0 }
  }
})

